#!/bin/bash
set -e

if [ "$1" = purge ]; then
	if [ -f /sbin/start ]; then
		if [ -f /etc/init/anybackupserver.conf ]; then
			stop anybackupserver 2> /dev/null > /dev/null || true
		fi
	else
		if [ -f /etc/init.d/anybackupserver ]; then
			/sbin/service anybackupserver stop 2>&1 > /dev/null || true
		fi
		update-rc.d anybackupserver remove
	fi
fi
